home *** CD-ROM | disk | FTP | other *** search
- property scrollUpBtn, scrollDownBtn, scrollColumn, scrollThumb, scrollThumbRect, disableSprite, theScrollBarLength, theScrollBarTop, theScrollBarBottom, theThumbLength
- global theExportDialog
-
- on birth me
- set scrollColumn to 7
- set scrollUpBtn to 8
- set scrollDownBtn to 9
- set scrollThumb to 10
- set scrollThumbRect to 11
- set disableSprite to 12
- puppetSprites(scrollColumn, disableSprite, 1)
- set theThumbLength to the width of sprite scrollThumb
- set theScrollBarTop to the left of sprite scrollColumn
- set theScrollBarBottom to the right of sprite scrollColumn
- set theScrollBarLength to the width of sprite scrollColumn
- return me
- end
-
- on update me
- set currentFileNumber to getCurrentFileNumber(theExportDialog)
- set totalPositions to getTheNumberOfFiles(theExportDialog)
- if currentFileNumber = 1 then
- set the locH of sprite scrollThumb to theScrollBarTop + (theThumbLength / 2)
- else
- if currentFileNumber = totalPositions then
- set the locH of sprite scrollThumb to theScrollBarBottom - (theThumbLength / 2)
- else
- set theIncrement to (theScrollBarLength - (theThumbLength * 2)) / (totalPositions - 1.0)
- set theThumbPosition to (currentFileNumber - 1.0) * theIncrement
- set the locH of sprite scrollThumb to theScrollBarTop + theThumbLength + theThumbPosition
- end if
- end if
- set the locH of sprite scrollThumbRect to -1000
- end
-
- on moveThumbRect me, theThumbPosition
- set currentFileNumber to getCurrentFileNumber(theExportDialog)
- set totalPositions to getTheNumberOfFiles(theExportDialog)
- set theThumbPosition to theThumbPosition - theScrollBarTop
- set theIncrement to theScrollBarLength / totalPositions
- repeat with count = 1 to totalPositions
- if theThumbPosition < (count * theIncrement) then
- set theFilePosition to count
- exit repeat
- end if
- end repeat
- set theDirection to theFilePosition - currentFileNumber
- update(theExportDialog, theDirection)
- set the locH of sprite scrollThumbRect to -1000
- end
-
- on disable me
- set the locH of sprite disableSprite to 151
- updateStage()
- end
-
- on enable me
- set the locH of sprite disableSprite to -1000
- updateStage()
- end
-
- on handleButton me, whichSprite
- if hiliteButton(whichSprite) then
- if whichSprite = scrollUpBtn then
- decrementFilePointer(theExportDialog)
- else
- if whichSprite = scrollDownBtn then
- incrementFilePointer(theExportDialog)
- end if
- end if
- end if
- end
-